package com.android.home.adapter.holder;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.android.common.base.rv.BaseRvHolder;
import com.android.home.R;
import com.android.home.mvp.model.home.HomeThirdBean;

public class MsgNoticeEnterHolder extends BaseRvHolder<HomeThirdBean> {

    public static final int TYPE_MSG_NOTICE_ENTER = MyInfoHolder.TYPE_MY_INFO + 1;

    private Context mContext;

    private final TextView mTvName;

    private final ImageView mIvIcon;

    private final ImageView mIvRedDot;

    public MsgNoticeEnterHolder(View itemView) {
        super(itemView);
        mContext = itemView.getContext();
        mTvName = itemView.findViewById(R.id.tv_name);
        mIvIcon = itemView.findViewById(R.id.iv_icon);
        mIvRedDot = itemView.findViewById(R.id.iv_red_dot);
    }

    @Override
    public void bindData(HomeThirdBean bean, int position) {
        mTvName.setText(bean.getText());
        mIvIcon.setImageResource(bean.getIcon());
        if (bean.getVisibility()){
            mIvRedDot.setVisibility(View.VISIBLE);
        }else {
            mIvRedDot.setVisibility(View.GONE);
        }
    }
}
